home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / news / readers / skim-0.8 / skim-0 / skim-0.8.4 / VarBuf.h < prev    next >
C/C++ Source or Header  |  1996-02-18  |  3KB  |  83 lines

  1. /*
  2.  * NAME
  3.  *   VarBuf.h
  4.  * COPYRIGHT
  5.  *   VarBuf - Variable size buffer ADT.
  6.  *   Copyright (C) 1996  Rene W.J. Pijlman
  7.  *
  8.  *   This program is free software; you can redistribute it and/or modify
  9.  *   it under the terms of the GNU General Public License as published by
  10.  *   the Free Software Foundation; either version 2 of the License, or
  11.  *   (at your option) any later version.
  12.  *
  13.  *   This program is distributed in the hope that it will be useful,
  14.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  *   GNU General Public License for more details.
  17.  *
  18.  *   You should have received a copy of the GNU General Public License
  19.  *   along with this program; if not, write to the Free Software
  20.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  * VERSION
  22.  *   $Header: /home/rene/sys/CVS_MasterSourceRepository/skim/VarBuf.h,v 1.8 1996/02/16 23:10:56 rene Exp $
  23.  *   Distributed with Skim version 0.8.4.
  24.  */
  25.  
  26. #ifndef _VARBUF_H_
  27. #define _VARBUF_H_
  28.  
  29. #include <stdarg.h>
  30. #include <stdlib.h>
  31.  
  32. #include "Types.h"
  33. #include "StandardIO.h"
  34.  
  35. typedef int (*VBCompareFunction)( VarBuf, VarBuf );
  36.  
  37. /* Create and destroy. */
  38. VarBuf VBCreate( void );
  39. VarBuf VBCreateString( const char * );
  40. VarBuf VBClone( VarBuf );
  41. void VBDestroy( VarBuf );
  42.  
  43. /* Adding stuff. */
  44. void VBAppendString( VarBuf, const char * );
  45. void VBAppendCharacter( VarBuf, const char );
  46. void VBPrintf( VarBuf, const char *, ...);
  47. void VBPrintfVA( VarBuf, const char *, va_list );
  48. void VBAppendVB( VarBuf, VarBuf );
  49. void VBAppendBytes( VarBuf, void *, size_t );
  50. void VBAppendVBReference( VarBuf , VarBuf );
  51. void VBAppendVoidPtr( VarBuf , void * );
  52.  
  53. /* I/O. */
  54. #define WITH_NEWLINE True
  55. #define WITHOUT_NEWLINE False
  56. Boolean VBReadLine( VarBuf, StandardIO, Boolean );
  57. void VBReadFile( VarBuf, StandardIO );
  58. void VBWriteFile( VarBuf, StandardIO );
  59.  
  60. /* Queries. */
  61. Boolean VBIsOK( VarBuf );
  62. void * VBAddress( VarBuf );
  63. char * VBAsString( VarBuf );
  64. size_t VBSize( VarBuf );
  65. Natural VBNumberOfLines( VarBuf );
  66.  
  67. /* VB manipulation. */
  68. void VBReset( VarBuf );
  69. void VBShiftLeft( VarBuf, size_t );
  70. void VBShiftRight( VarBuf, size_t, char );
  71. void VBTruncate( VarBuf, size_t );
  72. void VBFixSize( VarBuf , size_t , char );
  73. void VBRemoveLeadingBlanks( VarBuf );
  74. void VBRemoveTrailingBlanks( VarBuf );
  75. void VBSplitAtOffset( VarBuf In, size_t Offset, VarBuf Part1, VarBuf Part2 );
  76. void VBEndWithNewline( VarBuf );
  77.  
  78. /* Utilities. */
  79.  
  80. void VBSortArrayOfVB( VarBuf Array, VBCompareFunction UserCompare );
  81.  
  82. #endif
  83.